<?PHP
  class Login extends Editor{
  
    public function display(){
		?>
			<h2>Login</h2>
		<?PHP
		if($_POST['name']){
			if($_SESSION['user']->login($_POST['name'],$_POST['password'])){
				echo "Hallo ".$_SESSION['user']->name;
			}
			else{
				echo "Login fehlgeschlagen!";
			}
		}
		if($_SESSION['user']->isGuest()){
			?>
			<form action="<?PHP echo $_SERVER['SCRIPT_URI']; ?>" method="POST">
				<table>
					<tr>
						<td>Benutzername:</td>
						<td><input name="name" /></td>
					</tr>
					<tr>
						<td>Passwort:</td>
						<td> <input name="password" type="password" /></td>
					</tr>
				</table>
				<input type="submit" value="Login" />
			</form>
			<?PHP
		}
	}
    function getHeader(){
    }
	
	public function getEditableCode(){
	  return "<input name=\"save\" type=\"submit\" value=\"&Auml;ndern\" onclick=\"form.action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."' ; target='_self' ; return true\" />";
	}
	
	public function save($newPage,$oldPage){
	}	
}
?>